# -*- coding: utf-8 -*-
# Project : flacon
# File : wav_encoder.py
# (c) Alexander Sokolov sokoloff.a@gmail.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.



import encoder
from PyQt4 import QtCore
from errors import *

class WavEncoder(encoder.Encoder):
    id = 'WAV'
    extension = 'wav'
    name = 'WAV'


   #****************************************************************
   #
   #****************************************************************
    def encode(self):
        inFile = QtCore.QFile(self._wavFile)
        if not inFile.rename(self._outFile):
            raise ConvertError(self.tr("Can't rename file:\n%1 to %2\n%3").arg(self._wavFile, self._outFile).arg(inFile.errorString()))


   #****************************************************************
   #
   #****************************************************************
    @classmethod
    def programs(cls):
        return []


#****************************************************************
# Register encoder & gain classes
#****************************************************************
encoder.registerEncoder(WavEncoder)
